<?php if (!defined('THINK_PATH')) exit(); /*a:4:{s:94:"/Users/mac/Documents/www/other/wswapp/public/../application/admin/view/expressquery/index.html";i:1757567732;s:80:"/Users/mac/Documents/www/other/wswapp/application/admin/view/layout/default.html";i:1750983057;s:77:"/Users/mac/Documents/www/other/wswapp/application/admin/view/common/meta.html";i:1750983057;s:79:"/Users/mac/Documents/www/other/wswapp/application/admin/view/common/script.html";i:1750983057;}*/ ?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
<title><?php echo (isset($title) && ($title !== '')?$title:''); ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta name="renderer" content="webkit">
<meta name="referrer" content="never">
<meta name="robots" content="noindex, nofollow">

<link rel="shortcut icon" href="/assets/img/favicon.ico" />
<!-- Loading Bootstrap -->
<link href="/assets/css/backend<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.css?v=<?php echo \think\Config::get('site.version'); ?>" rel="stylesheet">

<?php if(\think\Config::get('fastadmin.adminskin')): ?>
<link href="/assets/css/skins/<?php echo \think\Config::get('fastadmin.adminskin'); ?>.css?v=<?php echo \think\Config::get('site.version'); ?>" rel="stylesheet">
<?php endif; ?>

<!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
<!--[if lt IE 9]>
  <script src="/assets/js/html5shiv.js"></script>
  <script src="/assets/js/respond.min.js"></script>
<![endif]-->
<script type="text/javascript">
    var require = {
        config:  <?php echo json_encode($config); ?>
    };
</script>

    </head>

    <body class="inside-header inside-aside <?php echo defined('IS_DIALOG') && IS_DIALOG ? 'is-dialog' : ''; ?>">
        <div id="main" role="main">
            <div class="tab-content tab-addtabs">
                <div id="content">
                    <div class="row">
                        <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                            <section class="content-header hide">
                                <h1>
                                    <?php echo __('Dashboard'); ?>
                                    <small><?php echo __('Control panel'); ?></small>
                                </h1>
                            </section>
                            <?php if(!IS_DIALOG && !\think\Config::get('fastadmin.multiplenav') && \think\Config::get('fastadmin.breadcrumb')): ?>
                            <!-- RIBBON -->
                            <div id="ribbon">
                                <ol class="breadcrumb pull-left">
                                    <?php if($auth->check('dashboard')): ?>
                                    <li><a href="dashboard" class="addtabsit"><i class="fa fa-dashboard"></i> <?php echo __('Dashboard'); ?></a></li>
                                    <?php endif; ?>
                                </ol>
                                <ol class="breadcrumb pull-right">
                                    <?php foreach($breadcrumb as $vo): ?>
                                    <li><a href="javascript:;" data-url="<?php echo $vo['url']; ?>"><?php echo $vo['title']; ?></a></li>
                                    <?php endforeach; ?>
                                </ol>
                            </div>
                            <!-- END RIBBON -->
                            <?php endif; ?>
                            <div class="content">
                                
<style type="text/css">
    @media (max-width: 375px) {
        .edit-form tr td input {
            width: 100%;
        }
    }
    .string   { color: green; }
    .number   { color: darkorange; }
    .boolean  { color: blue; }
    .null     { color: magenta; }
    .key      { color: red; }
</style>
<div class="panel panel-default panel-intro">
    <div class="panel-heading">
        <div class="panel-lead" style="line-height: 22px;">
            <em><?php echo __('Warning'); ?></em>
            快递鸟接口：目前“百世快递、申通快递、天天快递”不支持免费查询。<br/>
            快递100接口：您可根据需求申请/购买快递100账号，使用免费接口和企业接口。
        </div>
        <ul class="nav nav-tabs">
            <li class="active"><a href="#edit" data-toggle="tab">物流接口配置</a></li>
            <li><a href="#demo" data-toggle="tab">接口测试</a></li>
            <li><a href="#help" data-toggle="tab">使用说明</a></li>
        </ul>
    </div>

    <div class="panel-body" style="padding-bottom: 0;">
        <div id="myTabContent" class="tab-content">
            <div class="tab-pane active" id="edit">
                <div class="widget-body no-padding">
                    <form id="edit-form" class="edit-form form-horizontal" role="form" data-toggle="validator" method="POST" action="">
                        <?php echo token(); ?>
                        <table class="table table-striped">
                            <thead>
                            <tr>
                                <th width="15%"><?php echo __('Title'); ?></th>
                                <th width="85%"><?php echo __('Value'); ?></th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr>
                                <td><?php echo __('Express_type'); ?></td>
                                <td>
                                    <div class="row">
                                        <div class="col-sm-8 col-xs-12">
                                            <div class="radio">
                                                <?php if(is_array($expressTypeList) || $expressTypeList instanceof \think\Collection || $expressTypeList instanceof \think\Paginator): if( count($expressTypeList)==0 ) : echo "" ;else: foreach($expressTypeList as $key=>$vo): ?>
                                                <label for="row[express_type]-<?php echo $key; ?>">
                                                    <input id="row[express_type]-<?php echo $key; ?>" <?php if(in_array(($key), is_array($row['express_type'])?$row['express_type']:explode(',',$row['express_type']))): ?>class="express_type" checked="checked"<?php endif; ?> name="row[express_type]" type="radio" value="<?php echo $key; ?>"> <?php echo $vo; ?>
                                                </label>
                                                <?php endforeach; endif; else: echo "" ;endif; ?>
                                            </div>
                                        </div>
                                        <div class="col-sm-4"></div>
                                    </div>
                                </td>
                            </tr>

                            <tr class="kuaidiniao" style="display: none">
                                <td><?php echo __('Express_bird_userid'); ?></td>
                                <td>
                                    <div class="row">
                                        <div class="col-sm-8 col-xs-12">
                                            <input id="c-express_bird_userid" class="form-control" name="row[express_bird_userid]" type="text" value="<?php echo htmlentities($row['express_bird_userid']); ?>">
                                        </div>
                                        <div class="col-sm-4"></div>
                                    </div>
                                </td>
                            </tr>

                            <tr class="kuaidiniao" style="display: none">
                                <td><?php echo __('Express_bird_apikey'); ?></td>
                                <td>
                                    <div class="row">
                                        <div class="col-sm-8 col-xs-12">
                                            <input id="c-express_bird_apikey" class="form-control" name="row[express_bird_apikey]" type="text" value="<?php echo htmlentities($row['express_bird_apikey']); ?>">
                                        </div>
                                        <div class="col-sm-4"></div>
                                    </div>
                                </td>
                            </tr>

                            <tr class="kuaidiniao" style="display: none">
                                <td><?php echo __('Express_bird_customer_name'); ?></td>
                                <td>
                                    <div class="row">
                                        <div class="col-sm-8 col-xs-12">
                                            <input id="c-express_bird_customer_name" class="form-control" name="row[express_bird_customer_name]" type="text" value="<?php echo htmlentities($row['express_bird_customer_name']); ?>" placeholder="若您使用京东物流，则需填写‘京东商家编码’，否则将会造成物流信息无法查询">
                                        </div>
                                        <div class="col-sm-4"></div>
                                    </div>
                                </td>
                            </tr>

                            <tr class="kuaidi100" style="background-color: #fff!important;display: none">
                                <td><?php echo __('Kuaidi100_type'); ?></td>
                                <td>
                                    <div class="row">
                                        <div class="col-sm-8 col-xs-12">
                                            <div class="radio">
                                                <?php if(is_array($kuaidi100TypeList) || $kuaidi100TypeList instanceof \think\Collection || $kuaidi100TypeList instanceof \think\Paginator): if( count($kuaidi100TypeList)==0 ) : echo "" ;else: foreach($kuaidi100TypeList as $key=>$vo): ?>
                                                <label for="row[kuaidi100_type]-<?php echo $key; ?>">
                                                    <input id="row[kuaidi100_type]-<?php echo $key; ?>" <?php if(in_array(($key), is_array($row['kuaidi100_type'])?$row['kuaidi100_type']:explode(',',$row['kuaidi100_type']))): ?>checked="checked" class="kuaidi100_type" <?php endif; ?> name="row[kuaidi100_type]" type="radio" value="<?php echo $key; ?>"> <?php echo $vo; ?>
                                                </label>
                                                <?php endforeach; endif; else: echo "" ;endif; ?>
                                            </div>
                                        </div>
                                        <div class="col-sm-4"></div>
                                    </div>
                                </td>
                            </tr>

                            <tr class="kuaidi100" style="display: none">
                                <td><?php echo __('Apikey'); ?></td>
                                <td>
                                    <div class="row">
                                        <div class="col-sm-8 col-xs-12">
                                            <input id="c-apikey" class="form-control" name="row[apikey]" type="text" value="<?php echo htmlentities($row['apikey']); ?>">
                                        </div>
                                        <div class="col-sm-4"></div>
                                    </div>
                                </td>
                            </tr>

                            <tr class="kuaidi100_customer" style="display: none">
                                <td><?php echo __('Customer'); ?></td>
                                <td>
                                    <div class="row">
                                        <div class="col-sm-8 col-xs-12">
                                            <input id="c-customer" class="form-control" name="row[customer]" type="text" value="<?php echo htmlentities($row['customer']); ?>">
                                        </div>
                                        <div class="col-sm-4"></div>
                                    </div>
                                </td>
                            </tr>

                            <tr class="ali" style="display: none">
                                <td><?php echo __('Aliappcode'); ?></td>
                                <td>
                                    <div class="row">
                                        <div class="col-sm-8 col-xs-12">
                                            <input id="c-aliappcode" class="form-control" name="row[aliappcode]" type="text" value="<?php echo htmlentities($row['aliappcode']); ?>">
                                        </div>
                                        <div class="col-sm-4"></div>
                                    </div>
                                </td>
                            </tr>

                            <tr>
                                <td><?php echo __('Express_bird_cache'); ?></td>
                                <td>
                                    <div class="row">
                                        <div class="col-sm-8 col-xs-12">
                                            <input id="c-express_bird_cache" class="form-control" name="row[express_bird_cache]" type="number" value="<?php echo htmlentities($row['express_bird_cache']); ?>">
                                        </div>
                                        <div class="col-sm-4"></div>
                                    </div>
                                </td>
                            </tr>
                            </tbody>
                            <tfoot>
                            <tr>
                                <td></td>
                                <td>
                                    <button type="submit" class="btn btn-success btn-embossed"><?php echo __('OK'); ?></button>
                                    <button type="reset" class="btn btn-default btn-embossed"><?php echo __('Reset'); ?></button>
                                </td>
                                <td></td>
                                <td></td>
                            </tr>
                            </tfoot>
                        </table>
                    </form>
                </div>
            </div>
            <div class="tab-pane " id="demo">
                <div class="widget-body no-padding">
                    <form id="demo-form" class="demo-form form-horizontal" role="form" data-toggle="validator" method="POST" action="expressquery/demo">
                        <?php echo token(); ?>
                        <table class="table table-striped" style="width: 40%;">
                            <thead>
                            <tr>
                                <th width="25%"><?php echo __('Title'); ?></th>
                                <th width="75%"><?php echo __('Value'); ?></th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr>
                                <td><?php echo __('快递公司'); ?></td>
                                <td>
                                    <div class="row">
                                        <div class="col-sm-8 col-xs-12">
                                            <select  data-rule="required" class="form-control" name="row[express]">
                                                <option value="">请选择</option>
                                                <?php if(is_array($expressList) || $expressList instanceof \think\Collection || $expressList instanceof \think\Paginator): if( count($expressList)==0 ) : echo "" ;else: foreach($expressList as $key=>$vo): ?>
                                                <option value="<?php echo $vo['express']; ?>"><?php echo $vo['name']; ?></option>
                                                <?php endforeach; endif; else: echo "" ;endif; ?>
                                            </select>
                                        </div>
                                        <div class="col-sm-4"></div>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td><?php echo __('快递单号'); ?></td>
                                <td>
                                    <div class="row">
                                        <div class="col-sm-8 col-xs-12">
                                            <input class="form-control" name="row[expresssn]" type="text" value="">
                                        </div>
                                        <div class="col-sm-4"></div>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td><?php echo __('收/寄件人电话'); ?></td>
                                <td>
                                    <div class="row">
                                        <div class="col-sm-8 col-xs-12">
                                            <input class="form-control" name="row[phone]" type="text" value="">
                                        </div>
                                        <div class="col-sm-4"></div>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td></td>
                                <td>
                                    <div class="row">
                                        <div class="col-sm-12 col-xs-12" style="color: #999">
                                            收、寄件人的电话号码（手机和固定电话均可，只能填写一个，顺丰速运、顺丰快运必填，其他快递公司选填。
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td></td>
                                <td>
                                    <button type="submit" class="btn btn-success btn-embossed"><?php echo __('OK'); ?></button>
                                    <button type="reset" class="btn btn-default btn-embossed"><?php echo __('Reset'); ?></button>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                        <table class="table table-striped">
                            <thead>
                            <tr>
                                <th width="25%"><?php echo __('响应输出'); ?></th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr>
                                <td style="height: 600px;background-color: #fff;border-left: 1px solid #f4f4f4;"><pre id="express_content"></pre></td>
                            </tr>
                            </tbody>
                        </table>
                    </form>
                </div>
            </div>
            <div class="tab-pane " id="help">
                <div class="widget-body no-padding">
                    <pre>
/**
 * 测试物流查询接口
 * @param $params['express']        物流公司编码，这里传进来的是express数据表中的express字段值
 * @param $params['expresssn']      物流单号
 * @author Created by Xing <464401240@qq.com>
 */
public function demo()
{
    if ($this->request->isPost()) {
        $params = $this->request->post("row/a");
        if ($params) {
            //在需要查询物流接口的地方使用以下两行代码即可返回数据
            $expModle = new \addons\expressquery\library\Expressquery();
            //$params['express']   物流公司编码
            //$params['expresssn'] 物流单号
            $list = $expModle->getExpressList($params['express'], $params['expresssn'], $params['phone']);
            return json($list);
        }
    }
    $this->error(__('An unexpected error occurred', ''));
}
                    </pre>
                </div>
            </div>
        </div>
    </div>
</div>

                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <script src="/assets/js/require<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.js" data-main="/assets/js/require-backend<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.js?v=<?php echo htmlentities($site['version']); ?>"></script>
    </body>
</html>
